package com.cts.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @author tongshengchen
 * @TableName login_log
 */
@TableName(value ="login_log")
@Data
@NoArgsConstructor
public class LoginLog implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名称
     */
    @TableField(value = "username")
    private String username;

    /**
     * ip
     */
    @TableField(value = "ip")
    private String ip;

    /**
     * ip来源
     */
    @TableField(value = "ip_source")
    private String ipSource;

    /**
     * 操作系统
     */
    @TableField(value = "os")
    private String os;

    /**
     * 浏览器
     */
    @TableField(value = "browser")
    private String browser;

    /**
     * 登录状态
     */
    @TableField(value = "status")
    private Boolean status;

    /**
     * 操作描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 登录时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * user-agent用户代理
     */
    @TableField(value = "user_agent")
    private String userAgent;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public LoginLog(String username, String ip, String ipSource, Boolean status, String description, String userAgent, String os, String browser) {
        this.username = username;
        this.ip = ip;
        this.ipSource = ipSource;
        this.status = status;
        this.description = description;
        this.userAgent = userAgent;
        this.os = os;
        this.browser = browser;
    }
}